﻿Public Class PlugIn
    Implements Framework.Plugin.IPlugIn

    Friend Const TabKey As String = "Backup"
    Private mUC As BackupTabControl

    Private Sub Start(ByVal host As Framework.Plugin.IHost) Implements Framework.Plugin.IPlugIn.Start
        If mUC Is Nothing Then
            mUC = New BackupTabControl
            mUC.Start()
            host.AddTabImage(TabKey, My.Resources.harddisc_20x20.ToBitmap)
            host.AddTab(TabKey, TabKey, "Backups", mUC)

            Framework.Settings.Provider.RegisterTab("Backup", GetType(SettingsControl))

            host.CreateMenu(Me, TabKey, "Backup")
            host.AddMenuItem(Me, TabKey, "RSF", "Restore single file...")
        End If
        Engine.Manager.Start()
    End Sub
    Private Sub [Stop](ByVal message As Framework.Message) Implements Framework.Plugin.IPlugIn.Stop
        Engine.Manager.Stop(message)
        If mUC IsNot Nothing Then
            mUC.Stop()
            mUC = Nothing
        End If
    End Sub
    Private Sub MenuItemClicked(ByVal menuItemKey As String) Implements Framework.Plugin.IPlugIn.MenuItemClicked
        Dim clsView As New FRestoreFileset
        clsView.Show()
    End Sub

End Class